; * Volume Control snippet by Eric^^
; * eIRCweb.cjb.net 
; * #eIRC - Undernet

; on load
on *:load:{
echo -a *** You have loaded 'Volume Control' by Eric^^ / http://eIRCweb.cjb.net
echo -s *** You have loaded 'Volume Control' by Eric^^ / http://eIRCweb.cjb.net
}

alias volume {
 ; opens the dialog
 dialog -md volume volume 
}

alias didra {
; clears the editbox/text
did -r $1 $2
; writes to the editbox/text
did -a $1 $2 $3-
}

; the dialog itself
dialog volume {
  title Volume
  size -1 -1 200 130
  button "Close",1, 0 110 200 20,cancel
  box "Volume",2,10 10 180 75
  button "Up",3,50 30 40 20
  button "Down",4,50 50 40 20
  edit $vol(master),5,110 40 50 20,read
  button "Low",6, 10 90 40 20 
  button "Medium",7, 57 90 40 20
  button "High",8, 103 90 40 20
  button "Mute",9, 150 90 40 20
}
; Control buttons
on *:dialog:volume:sclick:9:vol -v 0 | didra volume 5 Mute
on *:dialog:volume:sclick:8:vol -v 65535 | didra volume 5 High
on *:dialog:volume:sclick:7:vol -v 40000 | didra volume 5 Medium
on *:dialog:volume:sclick:6:vol -v 15000 | didra volume 5 Low
on *:dialog:volume:sclick:4:vol -v $calc($vol(master) - 500) | didra volume 5 $vol(master)
on *:dialog:volume:sclick:3:vol -v $calc($vol(master) + 500) | didra volume 5 $vol(master)
